package api

import (
	"chat/api/handler"
	"chat/consts"
	"chat/pkg"
	"github.com/gin-gonic/gin"
)

func RunLoginTime(r *gin.Engine) {
	r.GET("/ping", handler.Ping)
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.Reginster)
			user.POST("login", handler.Login)
			user.GET("demo", handler.Demo)
		}
		video := api.Group("/video")
		{

			video.Use(pkg.JwtAuth(consts.JWT_KEY))
			video.POST("add", handler.UserAdd)
			video.GET("userlist", handler.UserList)
			video.POST("userlike", handler.UserLike)
		}
	}

}
